package com.yihao.biz.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSON;
import com.yihao.biz.entity.User;
import com.yihao.biz.service.UserService;

@RestController
@RequestMapping(value = "/sys/user")
public class UserController {
	private Logger logger = LoggerFactory.getLogger(getClass());
	
	@Autowired
	private UserService userService;
	
	@RequestMapping("/getUserList")
    public String getUserList(User user) {
		logger.debug("getUserList");
        return JSON.toJSONString(userService.getUserList(user));
    }
	
	@RequestMapping("/getUserById")
    public String getUserById(User user) {
		logger.debug("getUserById");
        return JSON.toJSONString(userService.getUserById(user.getId()));
    }
}
